package com.guang.springbootexception.exception;

/**
 * 定义service级别的异常处理
 */
public class ServiceException extends Exception {
    /**
     * 错误码
     */
    private Integer errCode;
    /**
     * 错误消息
     */
    private String errMsg;

    public ServiceException(Integer errCode, String errMsg) {
        super(errMsg);
        this.errCode = errCode;
        this.errMsg = errMsg;
    }

    public ServiceException(Integer errCode, String errMsg, Throwable t) {
        super(errMsg, t);
        this.errCode = errCode;
        this.errMsg = errMsg;
    }

    public Integer getErrCode() {
        return this.errCode;
    }

    public String getErrMsg() {
        return this.errMsg;
    }
}